package com.examfeign.controller;

import com.examfeign.FeignService.FeignServiceExamService;
import com.examfeign.VO.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :admin
 * @description: TODO edit class Description
 * @create date: 2019/4/14 16:59
 */
@RestController
public class DemoController {

    @Autowired
    FeignServiceExamService serviceExamService;

    @RequestMapping("/sayhello/{name}")
    public String sayhello(@PathVariable String name) {
        return serviceExamService.hello(name);
    }

    @RequestMapping("/helloUser")
    public User helloUser() {
        return serviceExamService.helloUser("tom",10);
    }

    @RequestMapping("/getHelloUser")
    public String getHelloUser() {
        return serviceExamService.getHelloUser(new User("tom",10));
    }

}
